package xin.lms.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import xin.core.jpa.JpaConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <pre>
 * 系统错误日志
 * </pre>
 *
 * @author lixin@outlook.com
 * @version 1.0
 * @since 2017/11/26 14:22
 */
@Entity
@Table(name = "sys_error_log")
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
public class ErrorLog  extends Log  implements Serializable {

    @Column(name = "_clazz", length = JpaConstant.EnterpriseNameColumnStringLength)
    private String clazz;

    @Column(name = "_method", length = JpaConstant.EnterpriseNameColumnStringLength)
    private String method;


    @Column(name = "error_code", length = JpaConstant.EnterpriseNameColumnStringLength)
    private String code;

    @Column(name = "message", length = JpaConstant.DescriptionColumnLength)
    private String message;

    @Column(length = JpaConstant.UidColumnLength, updatable = false)
    protected String operator;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column()
    protected LocalDateTime operateTime;
}
